import {
	createRouter,
	createWebHistory
} from 'vue-router';
import PageLogin from '../pages/login.vue';


const routes = [{
		path: '/',
		component: ()=>import("../pages/login.vue")
	},
	{
		path: "/editor",
		name: "editor",
		component: ()=>import("../pages/editor/layout.vue"),
		children: [{
			path: "basic/:panoid",
			name:'basic',
			component: ()=>import("../pages/editor/basic.vue"),
		},
		{
			path: "view/:panoid",
			name:'view',
			component: ()=>import("../pages/editor/view.vue"),
		},
		{
			path: "hotspot/:panoid",
			name:'hotspot',
			component: ()=>import("../pages/editor/hotspot.vue"),
		},
		{
			path: "cruise/:panoid",
			name:'cruise',
			component: ()=>import("../pages/editor/cruise.vue"),
		},
		{
			path: "mask/:panoid",
			name:'mask',
			component: ()=>import("../pages/editor/mask.vue"),
		},
		{
			path: "sandbox/:panoid",
			name:'sandbox',
			component: ()=>import("../pages/editor/sandbox.vue"),
		},
		{
			path: "music/:panoid",
			name:'music',
			component: ()=>import("../pages/editor/music.vue"),
		}]
	},
	{
		path: "/res",
		name: "res",
		redirect: '/res/tour',
		component: ()=>import("../pages/res/layout.vue"),
		children: [{
				path: "tour",
				component: ()=>import("../pages/res/tour.vue"),
			},
			{
				path: "panorama",
				component: ()=>import("../pages/res/panorama.vue"),
			},
			{
				path: "picture",
				component: ()=>import("../pages/res/picture.vue"),
			},
			{
				path: "video",
				component: ()=>import("../pages/res/video.vue"),
			},
			{
				path: "model",
				component: ()=>import("../pages/res/model.vue"),
			},
			{
				path: "audio",
				component: ()=>import("../pages/res/audio.vue"),
			}
		]

	}
];

const router = createRouter({
	history: createWebHistory(),
	routes
});

export default router;